<extend name="Base/common" />

<block name="style">
	<link href="__CSS__/Activity/act_detail.css" rel="stylesheet" />
</block>

<block name="body">
	<div class="pref">
		<input type="hidden" id="aid" value="{$act.id}"/>
		<div class="pref-row">
			<div class="text-align-center col-xs-12 col-md-12 p0">
				<img src="{$act.theme}" class="col-xs-12 col-md-5 pref-img p0">
			</div>
		</div>
		<h1 class="pref-title">{$act.title}</h1>
		<table class="pref-table">
			<tbody>
				<tr>
					<th>风格 :</th>
					<td>{$act.type}</td>
				</tr>
				<tr>
					<th>时间 :</th>
					<td>{$act.atime|date='Y年m月d日 H:i',###} - {$act.aetime|date='H:i',###}</td>
				</tr>
				<tr>
					<th>地址 :</th>
					<td>{$act.address}</td>
				</tr>
			</tbody>
		</table>
		<div class="text-align-center">
			{$want}
		</div>
	</div>
	<section id="act-content" class="act-content">
		<div>
			{$act.content|htmlspecialchars_decode|stripslashes}
		</div>
	</section>
	<notempty name="cooper">
		<div class="cooper">
			<h5>合作信息</h5>
			<div class="cooper-type-div">
				<div class="cooper-type text-align-center active" data-img="changdi"onclick="select(this)"  style="float: left;" >场地</div>
				<div class="cooper-type text-align-center" data-img="hezuo" onclick="select(this)">合作方</div>
			</div>
			<div class="logo" id="changdi">
				<foreach name="changdi_cooper" item="v">
					<div class="logo-div">
						<img class="logo-img" src="{$v.logourl}" />
						<p class="logo-span">{$v.name}</p>
					</div>
				</foreach>
			</div>
			<div class="logo" id="hezuo" hidden="hidden">
				<foreach name="hezuo_cooper" item="v">
					<div class="logo-div">
						<img class="logo-img" src="{$v.logourl}" />
						<p class="logo-span">{$v.name}</p>
					</div>
				</foreach>
			</div>
		</div>
	</notempty>
	<div class="modal fade " id="cancle_confirm_modal">
	  <div class="modal-dialog confirm-modal">
	    <div class="modal-content">
	      <div class="modal-header">
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	        <h4 class="modal-title">确定取消报名？</h4>
	      </div>
	      <div class="modal-footer">
	      	<button type="button" class="btn btn-default" id="confirm_cancle" data-dismiss="modal">  确认   </button>
	        <button type="button" class="btn btn-danger" data-dismiss="modal"> 关闭  </button>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
</block>
<block name="script">
	<script>
		function select(o){
			$('.cooper-type').removeClass('active');
			$(o).addClass('active');
			var data = $(o).attr('data-img');
			if(data=="changdi"){
				$('#hezuo').hide();
				$('#changdi').show();
			}else{
				$('#changdi').hide();
				$('#hezuo').show();
			}
		}
		$('#join').click(function(){
			location.href="{:U('User/joinact',array('aid'=>$act['id']))}";
		});
		$('#cancle').click(function(){
			$('#cancle_confirm_modal').modal();
//			location.href="{:U('User/cancle_act',array('aid'=>$act['id']))}";
		});
		$('#confirm_cancle').click(function(){
			//确认取消报名
			var aid = $('#aid').val();
			$.post("{:U('User/cancle_act')}",{aid:aid},function(res){
				if(res){
					swal('取消成功','','success');
					$('#cancle').hide();
					$('#join').removeClass('dn');
				}
			});
			
		});
	</script>
</block>